package com.shunli.cterminal.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.examples.core.mybatis.mapper.KyLambdaQueryWrapper;
import com.shunli.cterminal.entity.ExpGroupDO;
import com.shunli.cterminal.model.req.ExpGroupReq;

import java.util.List;


/**
 * ab实验分组 Mapper
 *
 * @author 后台管理员
 */
@DS("adEngine")
public interface ExpGroupMapper extends BaseMapper<ExpGroupDO> {


    default List<ExpGroupDO> queryExpGroupList(ExpGroupReq reqVO) {
        return selectList(new KyLambdaQueryWrapper<ExpGroupDO>()
                .eqIfPresent(ExpGroupDO::getAppId, reqVO.getAppId())
                .eqIfPresent(ExpGroupDO::getExpCode, reqVO.getExpCode())
                .eqIfPresent(ExpGroupDO::getExpId, reqVO.getExpId())
                .inIfPresent(ExpGroupDO::getExpCode,reqVO.getExpCodeList())
                .likeIfPresent(ExpGroupDO::getExpName, reqVO.getExpName())
                .likeIfPresent(ExpGroupDO::getExpGroupName, reqVO.getExpGroupName())
                .eqIfPresent(ExpGroupDO::getExpGroupParam, reqVO.getExpGroupParam())
                .eqIfPresent(ExpGroupDO::getStrategyId, reqVO.getStrategyId())
                .eqIfPresent(ExpGroupDO::getIdType, reqVO.getIdType())
                .eqIfPresent(ExpGroupDO::getSceneCode, reqVO.getSceneCode())
                .orderByAsc(ExpGroupDO::getId));
    }

}